/** COPYRIGHT(C) 2007. Natasha Khuri. All Rights Reserved.
    This class tests the Purse class
    @author Natasha Khuri
    @version 1.01 2007-10-28
*/
public class PurseTester
{
   public static void main(String[] args)
   {
      Purse p = new Purse();
      p.addCoin("Quarter");
      p.addCoin("Dime");
      p.addCoin("Nickel");
      p.addCoin("Dime");

      System.out.println("Original purse: " + p.toString());
      System.out.println("Expected: Purse[Quarter,Dime,Nickel,Dime]");
      System.out.println();

      p.reverse();
      System.out.println("Reversed purse: " + p.toString());
      System.out.println("Expected: Purse[Dime,Nickel,Dime,Quarter]");
      System.out.println();


      Purse a = new Purse();
      a.addCoin("Quarter");
      a.addCoin("Dime");
      a.addCoin("Nickel");
      a.addCoin("Dime");

      Purse b = new Purse();
      b.addCoin("Dime");
      b.addCoin("Nickel");

      a.transfer(b);

      System.out.println(a.toString());
      System.out.println("Expected: Purse[Quarter,Dime,Nickel,Dime,Dime,Nickel]");
      System.out.println(b.toString());
      System.out.println("Expected: Purse[]");
      System.out.println();

      Purse k = new Purse();
      k.addCoin("Quarter");
      k.addCoin("Dime");
      k.addCoin("Penny");

      Purse m = new Purse();
      m.addCoin("Quarter");
      m.addCoin("Penny");
      m.addCoin("Dime");
      

      System.out.println("Got "+k.sameContents(m));
      System.out.println("Expected1: false");

      Purse c = new Purse();
      c.addCoin("Nickel");
      c.addCoin("Dime");
      c.addCoin("Nickel");

      Purse d = new Purse();
      d.addCoin("Nickel");
      d.addCoin("Dime");
      d.addCoin("Quarter");

      System.out.println("Got "+c.sameContents(d));
      System.out.println("Expected2: false");

      Purse e = new Purse();
      e.addCoin("Nickel");
      e.addCoin("Dime");
      e.addCoin("Nickel");

      Purse f = new Purse();
      f.addCoin("Nickel");
      f.addCoin("Dime");

      System.out.println("Got "+e.sameContents(f));
      System.out.println("Expected3: false");
      System.out.println();

      Purse n = new Purse();
      n.addCoin("Quarter");
      n.addCoin("Dime");
      n.addCoin("Nickel");
      n.addCoin("Dime");

      Purse r = new Purse();
      r.addCoin("Nickel");
      r.addCoin("Dime");
      r.addCoin("Dime");
      r.addCoin("Quarter");

      System.out.println(n.sameCoins(r));
      System.out.println("Expected: true");

      Purse x = new Purse();
      x.addCoin("Quarter");
      x.addCoin("Penny");
      x.addCoin("Nickel");
      x.addCoin("Dime");

      Purse y = new Purse();
      y.addCoin("Nickel");
      y.addCoin("Dime");
      y.addCoin("Dime");
      y.addCoin("Quarter");

      System.out.println(x.sameCoins(y));
      System.out.println("Expected: false");


 }
}